package top.dotgo.model.shop.bean;

import cn.hutool.core.bean.BeanUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import top.dotgo.model.IBaseBean;
import top.dotgo.model.shop.ShopStaffEntity;
import top.dotgo.model.sys.bean.SysAccountBean;

import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * 商家 员工(ShopStaff)对象bean
 *
 * @author jornl
 * @date 2020-04-15 10:21:18
 */
@Getter
@Setter
@Accessors(chain = true)
public class ShopStaffBean extends ShopStaffEntity implements IBaseBean, Serializable {


    /**
     * 账号信息
     */
    private SysAccountBean account;
    @Null(message = "员工状态禁止修改")
    private Integer status;

    public static ShopStaffBean bean(ShopStaffEntity entity) {
        ShopStaffBean bean = new ShopStaffBean();
        BeanUtil.copyProperties(entity, bean);
        return bean;
    }

    @Override
    public ShopStaffEntity entity() {
        ShopStaffEntity entity = new ShopStaffEntity();
        BeanUtil.copyProperties(this, entity);
        return entity;
    }


}
